package com.stqf.scala.grammar.io

import java.util.Properties

import scala.io.Source

/**
  * Created by ASUS on 2018-01-30.
  */
object FileRw {
  val prop = new Properties()

  for (i <- 1 until 5)
    println(i)

  def main(args: Array[String]): Unit = {
    val uri = ClassLoader.getSystemResource("app.properties").toURI
    val source = Source.fromFile(uri)
    prop.load(source.reader)
    println(prop.getProperty("name"))
    source.close()
  }
}
